<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a = 2;
        var c = 3;
        /* if (a > 3){
            c = 4; 
        }else{
            c = 5;
        }
        console.log(c); */
        //三元
        /* a > 0 ? c = 10 :  c = 5;
        console.log(c); */
        /* c = a > 3 ? 4 : 5;
        console.log(c); */
        //与或非
        a < 3 || (c = 5);
        a < 3 && (c = 4);
        /* 
        a>2===>false
        这里，我们是与运算，（）
        
        前面如果是假的，就要进入||后面的运算
        ===》c=5----将5赋值给c
        */
       /*  console.log(a > 2 && (c = 4)); */
        /* 
        这里与运算

        */
       //a > 3 && (c = 4) || (c = 5);
        console.log(c);
    </script>
</body>
</html>